<style>
</style>
<template>
    <div>
        <Form :model="course" :label-width="90" label-position="left">
            <Row>
                <Col span="12">
                <FormItem label="课程编码">
                    <Input v-model="course.csId" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
                <Col span="12">
                <FormItem label="国家课程编码">
                    <Select v-model="course.ncId" filterable style="width: 90%;float: left;">
                        <Option v-for="item in ncIdList" :value="item.ncId" :key="item.ncId" :label="item.ncId">
                            <span>{{item.ncId}}</span>
                            <span style="float:right;color:#808695">{{item.ncName}}</span>
                        </Option>
                    </Select>
                </FormItem>
                </Col>
            </Row>
            <Row>
                <Col span="12">
                <FormItem label="课程名称">
                    <Input v-model="course.csName" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
                <Col span="12">
                <FormItem label="课程说明">
                    <Input v-model="course.csIntro" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
            </Row>
            <Row>
                <Col span="12">
                <FormItem label="试题来源">
                    <Select v-model="course.csTqsource" style="width: 90%;float: left;">
                        <Option value="全国命题">全国命题</Option>
                        <Option value="省内命题">省内命题</Option>
                        <Option value="省外协作命题">省外协作命题</Option>
                    </Select>
                </FormItem>
                </Col>
                <Col span="12">
                <FormItem label="课程状态">
                    <Select v-model="course.csState" style="width: 90%;float: left;">
                        <Option value="正常">正常</Option>
                        <Option value="注销">注销</Option>
                    </Select>
                </FormItem>
                </Col>
            </Row>
            <Row>
                <Col span="12">
                <FormItem label="学分">
                    <Input v-model="course.csCredit" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
                <Col span="12">
                <FormItem label="合格线">
                    <Input v-model="course.csPassline" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
            </Row>
            <Row>
                <Col span="12">
                <FormItem label="记分制">
                    <Select v-model="course.csPointsys" style="width: 90%;float: left;">
                        <Option value="100">百分制</Option>
                        <Option value="10">十分制</Option>
                    </Select>
                </FormItem>
                </Col>
                <Col span="12">
                <FormItem label="主观题分数">
                    <Input v-model="course.csSqmark" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
            </Row>
            <Row>
                <Col span="12">
                <FormItem label="客观题分数">
                    <Input v-model="course.csOqmark" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
                <Col span="12">
                <FormItem label="总分">
                    <Input v-model="course.csTotalmark" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
            </Row>
            <Row>
                <Col span="12">
                <FormItem label="考试时间">
                    <DatePicker @on-change="course.csExamtime=$event" type="datetime" placeholder="选择考试时间"
                        style="width: 90%;float: left;" />
                </FormItem>
                </Col>
                <Col span="12">
                <FormItem label="是否过程性考核">
                    <Select v-model="course.csIfpa" style="width: 90%;float: left;">
                        <Option value="1" label="是">是</Option>
                        <Option value="0" label="否">否</Option>
                    </Select>
                </FormItem>
                </Col>
            </Row>
            <Row>
                <Col span="12">
                <FormItem label="课程性质">
                    <Select v-model="course.csProperties" style="width: 90%;float: left;">
                        <Option value="理论">理论</Option>
                        <Option value="实践">实践</Option>
                    </Select>
                </FormItem>
                </Col>
                <Col span="12">
                <FormItem label="备注">
                    <Input v-model="course.csRemark" style="width: 90%;float: left;" type="text" />
                </FormItem>
                </Col>
            </Row>
            <Row>
                <Col span="12">
                <FormItem label="教材国际书号">
                    <Select v-model="course.tbIsbn" filterable style="width: 90%;float: left;">
                        <Option v-for="item in tbList" :value="item.tbIsbn" :key="item.tbIsbn" :label="item.tbIsbn">
                            <span>{{item.tbIsbn}}</span>
                            <span style="float:right;color:#808695">{{item.tbName}}</span>
                        </Option>
                    </Select>
                </FormItem>
                </Col>
                <Col span="12">
                <FormItem label="计划版本">
                    <Select v-model="course.mvId" filterable style="width: 90%;float: left;">
                        <Option v-for="item in mvIdList" :value="item.mvId" :key="item.mvName">{{ item.mvName }}
                        </Option>
                    </Select>
                </FormItem>
                </Col>
            </Row>
        </Form>
    </div>

</template>

<script>
    export default {
        data() {
            return {
                course: {},
                mvIdList: [],
                ncIdList: [],
                tbList: []
            }

        },
        created() {
            this.$axios.get(this.$host + '/course/management/allTextbooks?pageNum=1&pageSize=9999').then(res => {
                this.tbList = res.data.data.list
            })
            this.$axios.get(this.$host + '/professional/plan/majorVersions?pageNum=1&&pageSize=99999').then(res => {
                this.mvIdList = res.data.data.list
            })
            this.$axios.get(this.$host + '/course/management/allNationalCourses?pageNum=1&pageSize=9999').then(res => {
                this.ncIdList = res.data.data.list
            })

        },
        watch: {
            course: {
                handler() {
                    this.trans()
                },
                deep: true
            }
        },
        methods: {
            trans() {
                this.$emit('getCourse', this.course)
            }
        }
    }
</script>